Conversation
|
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
WalkthroughsetImportFileRocketChatAttachment in Messages.ts now performs two sequential database updates: first initializes Changes
Sequence Diagram(s)(omitted — change involves only application and database interactions) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/models/src/models/Messages.ts`:
- Around line 739-751: The first updateMany currently uses { ...query,
attachments: undefined } which won't match documents where attachments is null;
change that filter to explicitly match missing or null attachments, e.g. replace
the first argument of updateMany (the { ...query, attachments: undefined }
object) with { ...query, $or: [ { attachments: { $exists: false } }, {
attachments: null } ] } so those docs get reset to [] before the subsequent
updateMany that $addToSet the attachment.
acfab24 to
d6d24e2
Compare
Proposed changes (including videos or screenshots)
Fix
setImportFileRocketChatAttachment, by first setting "attachements" to[]when it isundefinedbefore trying to add attachments.Issue(s)
#37058 (comment)
Steps to test or reproduce
Steps to reproduce:
Admin->Importand clickDownloading pending filesErrors like this will be seen for every file that gets downloaded:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.